
export interface IPowerED {
    // status: boolean,
    activeAppDic: Record<string,APP> ;
    partitionAppDic:Record<string,APP> ;
    clientAppDicProxy?:Record<string,any> ;
    globalState:Partial<IGlobalState>;
    debugger:boolean

  }
  export type MicroProps = {
    name?:string;
    container?: HTMLElement;
    globalState?:IGlobalState
  };
  
  export type AppCss = { name: string, url: string, content?: string }
  export type AppJs= {
    name: string,
    url: string,
    content?: string
  }
  export interface APP {
    baseUrl:string,
    name: string,
    domId:string,
    appJs:Array<AppJs>,
    appCss:Array<AppCss>,
    htmlContent:string,
    htmlElement:HTMLElement,
    bootstrap: CallbackFn; mount: CallbackFn; unmount: CallbackFn,distory: CallbackFn
    // baseLife:LifeCycle,
    clientLife?:LifeCycle,
    execApp:()=>void,
    proxy?:any
  }
  export type AppParam=Pick<APP,'baseUrl'|'name'|'domId'|'appJs'|'appJs'|'htmlContent'|'htmlElement'|'appCss'>
  export type ClientApp=Omit<APP,'appJs'|'appCss'|'htmlContent'>
  export type ClientAppDic={[name:string]:ClientApp}; 
  export type CallbackFn= (props?: MicroProps) => void
  export type CallbackClientFn= (props: MicroProps) => Promise<void>

  //子应用绑定对戏那个
  export type LifeCycle={ bootstrap?: CallbackClientFn; mount?: CallbackClientFn; unmount?: CallbackClientFn}

 
  //全局对象
  export interface IGlobalState{
    global: ProxyHandler<{[state:string]:any}>
    onGlobalStateChange:(fn:(current,prev)=>void)=>void
    setGlobalState:(state:Record<string,any>)=>void 
  }